/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.dao;

import org.ipti.br.tag.entity.PersonageHolidayCalendar;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.ipti.br.tag.util.CalendarUtil;
import org.ipti.br.tag.util.EncryptionUtil;

/**
 *
 * @author israel
 */
@Stateless
public class PersonageHolidayCalendarFacade extends AbstractFacade<PersonageHolidayCalendar> {

    @PersistenceContext(unitName = "TAG2PU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public PersonageHolidayCalendarFacade() {
        super(PersonageHolidayCalendar.class);
    }

    @Override
    public void create(PersonageHolidayCalendar personageHolidayCalendar) {
        getEntityManager().persist(personageHolidayCalendar);
    }
    
    @Override
    public void edit(PersonageHolidayCalendar personageHolidayCalendar) {
        personageHolidayCalendar.setSerialNumber(null);
        
        getEntityManager().merge(personageHolidayCalendar);
    }
    
    public void editForSynchronization(PersonageHolidayCalendar personageHolidayCalendar) {
        getEntityManager().merge(personageHolidayCalendar);
    }
}
